//package com.cx.ucenter.controller;
//
//import com.google.common.collect.Lists;
//import lombok.AllArgsConstructor;
//import me.chanjar.weixin.common.error.WxErrorException;
//import me.chanjar.weixin.mp.api.WxMpService;
//import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
//import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
//import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.servlet.ModelAndView;
//
///**
// * @Author:chenxiaoyi
// * @Date:2019/11/25 16:18
// */
//@AllArgsConstructor
//@Controller
//public class MyController {
//
//    private final WxMpService wxMpService;
//
//    @GetMapping("/index")
//    public ModelAndView index(){
//        ModelAndView modelAndView = new ModelAndView("index.html");
//        modelAndView.addObject("value","123");
//        return modelAndView;
//    }
//
//
//    /**
//     * 测试发送消息
//     * @return
//     * @throws WxErrorException
//     */
//    @ResponseBody
//    @GetMapping("/sendMsg")
//    public String sendMsgTemplate() throws WxErrorException {
//        WxMpTemplateMessage build = WxMpTemplateMessage.builder()
//                .templateId("yJpOoLKZ-OKcFevC1BQTn2Y-0pNk6lkq4omd0pPxmWs")
//                .data(Lists.newArrayList(
//                        new WxMpTemplateData("title", "尊敬的用户,有收到最新的订单消息哦", ""),
//                        new WxMpTemplateData("keyword1", "￥888.88", "#FF0000"),
//                        new WxMpTemplateData("keyword2", "医药医疗器械,CT/彩超", "#D1D0CE"),
//                        new WxMpTemplateData("keyword3", "520-1314", "#173177"),
//                        new WxMpTemplateData("remark", "请注意查收,采购愉快...", "")
//                ))
//                .toUser("ogHpMwFgvLtcbrrItEPfeAFL7rmE")
//                .url("http://www.cmic.com.cn/Aboutus/Survey/")
//                .build();
//        String s = wxMpService.getTemplateMsgService().sendTemplateMsg(build);
//        return s;
//    }
//
//    /**
//     * 生成公众号二维码 扫码带参数可关注
//     * @return
//     * @throws WxErrorException
//     */
//    @ResponseBody
//    @GetMapping("/qrCode")
//    public String qrCode() throws WxErrorException {
//        WxMpQrCodeTicket h1 = wxMpService.getQrcodeService().qrCodeCreateTmpTicket("h_1", 3600);
//        String pictureUrl = wxMpService.getQrcodeService().qrCodePictureUrl(h1.getTicket());
//        return pictureUrl;
//    }
//
//
//
//
//
////    /**
////     * 生成小程序二维码 带参数 跳转页面
////     * @return
////     * @throws WxErrorException
////     */
////    @ResponseBody
////    @GetMapping("/miniCode")
////    public File miniCode() throws WxErrorException {
////        WxMaService maService = WxMaConfiguration.getMaService("");
////        File wxaCodeUnlimit = maService.getQrcodeService().createWxaCodeUnlimit("scene", "page");
////        return wxaCodeUnlimit;
////    }
//
//}
